package zhishuang.wang.sansi.playlist.entry;

/**
 * @Author Zhishuang.Wang
 * @Date 2023/7/5 11:10
 * @Email 1406110602@qq.com
 */

import zhishuang.wang.sansi.tools.ReturnData;

public class TextBase {
    private Integer audit;
    private String fontName;
    private String fontSize;
    private Integer wordSpace;
    private Integer lineSpace;
    private Integer showFlag;
    private Integer textType;
    private String textPath;
    private BaseColour fontColour;

    public TextBase() {
    }

    public TextBase(int textType, String textPath) {
        this.textType = textType;
        this.textPath = textPath;
    }

    public ReturnData checkParam() {
        ReturnData rd = new ReturnData();
        rd.setCode(1);
        String errorMes = "";
        if (this.textType != null && this.textPath != null) {
            if (this.textType < 0 || this.textType > 2) {
                errorMes = errorMes + "文本类型取值范围：0 - 1；";
            }

            ReturnData checkRd = null;
            if (this.fontColour != null) {
                checkRd = this.fontColour.checkParam();
                if (checkRd.getCode() != 0) {
                    errorMes = errorMes + checkRd.getMessage();
                }
            }

            if (this.showFlag != null && (this.showFlag < 0 || this.showFlag > 8)) {
                errorMes = errorMes + "文字对齐方式取值范围：0 - 8；";
            }
        } else {
            errorMes = errorMes + "文本类型、文本路径、播放时间等参数必填；";
        }

        if (errorMes != null && errorMes.length() != 0) {
            rd.setMessage(errorMes);
        } else {
            rd.setCode(0);
        }

        return rd;
    }

    public Integer getAudit() {
        return this.audit;
    }

    public void setAudit(Integer audit) {
        this.audit = audit;
    }

    public String getFontName() {
        return this.fontName;
    }

    public void setFontName(String fontName) {
        this.fontName = fontName;
    }

    public Integer getWordSpace() {
        return this.wordSpace;
    }

    public void setWordSpace(Integer wordSpace) {
        this.wordSpace = wordSpace;
    }

    public Integer getLineSpace() {
        return this.lineSpace;
    }

    public void setLineSpace(Integer lineSpace) {
        this.lineSpace = lineSpace;
    }

    public Integer getTextType() {
        return this.textType;
    }

    public void setTextType(Integer textType) {
        this.textType = textType;
    }

    public String getTextPath() {
        return this.textPath;
    }

    public void setTextPath(String textPath) {
        this.textPath = textPath;
    }

    public BaseColour getFontColour() {
        return this.fontColour;
    }

    public void setFontColour(BaseColour fontColour) {
        this.fontColour = fontColour;
    }

    public Integer getShowFlag() {
        return this.showFlag;
    }

    public void setShowFlag(Integer showFlag) {
        this.showFlag = showFlag;
    }

    public String getFontSize() {
        return this.fontSize;
    }

    public void setFontSize(String fontSize) {
        this.fontSize = fontSize;
    }
}
